﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Areas.Manage.Models.Site.NoticeModel>" %>
<%@ Import Namespace="Code.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	公告管理
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div>
    <% Html.BeginForm();%>
    <p><%=Html.ActionLink(">>新增", "EditNotice",null, new { @class="a_blue"})%></p>
    <table class="table" width="100%">
        <tr class="th"><th colspan="5" align="left">查找条件</th></tr>
        <tr>
            <td>
                <label for="Serch_Title">标题：</label>
                <%=Html.TextBoxFor(p => p.Serch.Title, new { @class="text150"})%>
                <%=Html.ValidationMessageFor(p=>p.Serch.Title) %>
            </td>
            <td>
                <label for="Serch_StartTime">日期：</label>
                <%=Html.TextBoxFor(p => p.Serch.StartTime, new { @class = "text80", onfocus = "WdatePicker()" })%>
                <%=Html.ValidationMessageFor(p=>p.Serch.StartTime) %>
            </td>
            <td>
                <label for="Serch_EndTime">至：</label>
                <%=Html.TextBoxFor(p => p.Serch.EndTime, new { @class="text80", onfocus = "WdatePicker()"})%>
                <%=Html.ValidationMessageFor(p=>p.Serch.EndTime) %>
            </td>
            <td>
                <label for="Serch.State">状态：</label>
                <%=Html.DropDownListFor(p => p.Serch.State,Model.States.Each(p=>p.Selected=p.Value==Model.Serch.State.ToString()))%>
                <%=Html.ValidationMessageFor(p=>p.Serch.State) %>
            </td>
            <td>
                <input type="submit" value="查找"/>
            </td>
        </tr>
    </table>
    <% Html.EndForm(); %>
    <p />
    <table class="table" width="100%">
        <tr class="th">
            <th width="150px">日期</th><th width="30">状态</th><th width="30">高亮</th><th>标题</th><th width="60">操作</th>
        </tr>
        <%if (Model.SumCount > 0)%>
        <%{%>
        <%foreach (var item in Model.Notices)%>
         <%{%>
        <tr>
            <td><%=item.AddTime.ToString("MM-dd HH:mm:ss") %></td>
            <td><%=item.State.GetName() %></td>
            <td><%=item.HighLight?"是":"否" %></td>
            <td align="left"><label title='<%=item.Title %>'><%=(item.Title??"").Length>30?item.Title.Substring(0,30)+"...":item.Title %></label></td>
            <td>
                <% var returnurl =new { item.ID, returnurl=Url.Action("Notice", Url.Route(new { Model.Page, Model.PageSize, Model.Serch }))}; %>
                <%=Html.ActionLink("编辑", "EditNotice", returnurl, new { @class = "a_blue" }) %>
                <%=Html.ActionLink("删除", "DeleteNotice", returnurl, new { @class = "a_blue", onclick = "return confirm('删除之后将无法恢复\\r\\n确定要删除该公告吗？')" })%>
            </td>
        </tr>
        <% } %>
        <tr><td colspan="5"><%=Html.Pager(Model.Page, Model.PageSize, Model.SumCount, "Page", Url.Route(new { Model.Serch}),"PageSize")%></td></tr>
        <%} %>
        <%else %>
        <%{ %>
        <tr><td colspan="5">没有找到符合条件的记录！</td></tr>
        <%} %>
    </table>

</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="StyleAndScript" runat="server">
</asp:Content>
